﻿<!DOCTYPE html>
<html class="x-admin-sm">

<head>
<meta charset="UTF-8">
<title>欢迎页面</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
{include file="public/style" /}
<script type="text/javascript">
	layui.use('form', function() {
		var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

		//……

		//但是，如果你的HTML是动态生成的，自动渲染就会失效
		//因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
		form.render();
	});
	$(document).ready(function(){
		$(".btn-save").click(function(){
		  if ($("input[name='pwd']").val() != '' && $("input[name='newpwd']").val()!='' && $("input[name='newpwd2']").val()!=''){
			$.ajax({
				type: 'post',    
				url: "{:url('editpwd')}",
				dataType: "json",
				data: $("form").serialize(),
				success: function(data) {
					layer.msg(data.msg);
					if (data.code == 1) {
					   $("input[name='pwd']").val('');
					   $("input[name='newpwd']").val('');
					   $("input[name='newpwd2']").val('');
					}
				}
			});
		  }
		})
	})
</script>
</head>
<body>
	<div class="layui-fluid">
		<div class="layui-row">
			<form class="layui-form" role="form" method="post" id="form-article-add" action="">
				<input type="hidden" name="id" value="{$Request.param.id}">
				<div class="layui-form-item">
					<label for="username" class="layui-form-label"><span class="x-red">*</span>原密码：</label>

					<div class="layui-input-inline">
						<input class="layui-input" placeholder="" type="password" name="pwd" value="" lay-verify="required">
					</div>
				</div>

				<div class="layui-form-item">
					<label for="username" class="layui-form-label"><span class="x-red">*</span>新密码：</label>
					<div class="layui-input-inline">
						<input class="layui-input" placeholder="" type="password" name="newpwd" lay-verify="required">
					</div>
				</div>
				<div class="layui-form-item">
					<label for="username" class="layui-form-label"><span class="x-red">*</span>再次密码：</label>
					<div class="layui-input-inline">
						<input class="layui-input" placeholder="" type="password" name="newpwd2" lay-verify="required">
					</div>
				</div>
				

				<div class="layui-form-item">
					<label for="L_repass" class="layui-form-label"> </label>
					<button type="button" class="layui-btn btn-save" lay-filter="add" lay-submit=""> 保 存 </button>
				</div>

			</form>

		</div>
	</div>
</body>
</html>
